﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace CPPEI.EBS.Proxy
{
    public class EBSResponse<T>
    {
        public string Namespace { get; private set; }
        public string Event { get; private set; }

        public T Data { get; private set; }

        public EBSResponse(HttpRequest request)
        {
            Namespace = request.Form["Namespace"];
            Event = request.Form["Event"];

            try
            {
                string data = request.Form["Data"];
                T Data = Newtonsoft.Json.JsonConvert.DeserializeObject<T>(data);
            }
            catch(Exception ex)
            {

            }
        }
    }

    public class EBSResponse
    {
        public string Data { get; private set; }
        public string Namespace { get; private set; }
        public string Event { get; private set; }

        public EBSResponse(HttpRequest request)
        {
            Data = request.Form["Data"];
            Namespace = request.Form["Namespace"];
            Event = request.Form["Event"];
        }
    }
}
